package com.goodving.guli.utility;

import android.content.Context;
import android.text.TextUtils;
import android.widget.Toast;

/**
 * Created by Administrator on 2015-11-16.
 */
public class StatusCode {
    public static final int ST_CODE_ACCESS_EXPIRED = 5027;
    public static final int ST_CODE_ACCESS_EXPIRED2 = 5028;
    public static final int ST_CODE_CONTENT_REPEAT = 5016;
    public static final int ST_CODE_ERROR = 40002;
    public static final int ST_CODE_ERROR_CANCEL = 40000;
    public static final int ST_CODE_ERROR_INVALID_DATA = 40001;
    public static final int ST_CODE_ERROR_WEIXIN = 5029;
    public static final int ST_CODE_NO_AUTH = 5014;
    public static final int ST_CODE_NO_SMS = 10086;
    public static final int ST_CODE_RESERVE_CODE = 5037;
    public static final int ST_CODE_SDK_INITQUEUE_FAILED = -104;
    public static final int ST_CODE_SDK_NORESPONSE = -103;
    public static final int ST_CODE_SDK_NO_OAUTH = -101;
    public static final int ST_CODE_SDK_SHARE_PARAMS_ERROR = -105;
    public static final int ST_CODE_SDK_UNKNOW = -102;
    public static final int ST_CODE_SUCCESSED = 200;
    public static final int ST_CODE_USER_BANNED = 505;

    public static int showErrMsg(Context context, int i, String str) {
        if (i == ST_CODE_SUCCESSED) {
//            Log.m21308w(SocializeConstants.COMMON_TAG, "call show error msg but error_code is " + i);
        } else if (i == ST_CODE_USER_BANNED) {
//            Toast.makeText(context, context.getString(ResContainer.getResourceId(context, ResType.STRING, "umeng_socialize_tip_blacklist")) + (SocializeConstants.SHOW_ERROR_CODE ? " [" + i + "]" : C3459a.f15323b), 1).show();
        } else if (i == ST_CODE_ACCESS_EXPIRED || ST_CODE_ACCESS_EXPIRED2 == i) {
            Toast.makeText(context, "\u6388\u6743\u5931\u6548\uff0c\u8bf7\u91cd\u65b0\u6388\u6743...", 0).show();
        } else if (i == ST_CODE_CONTENT_REPEAT) {
            Toast.makeText(context, "\u5206\u4eab\u5185\u5bb9\u91cd\u590d...", 0).show();
        } else if (i == ST_CODE_ERROR_CANCEL) {
            Toast.makeText(context, "\u53d6\u6d88\u5206\u4eab", 0).show();
        } else if (!TextUtils.isEmpty(str)) {
            Toast.makeText(context, new StringBuilder(String.valueOf(str)).append(" [").append(i).append("]").toString(), 1).show();
        }
        return i;
    }
}
